import { get, post, put, del } from './request'

// 评论相关API请求
const commentAPI = {
  // 创建评论
  createComment: (commentData) => {
    return post('/comments', commentData)
  },

  // 根据文章ID获取评论列表
  getCommentsByArticleId: (articleId) => {
    return get(`/comments/article/${articleId}`)
  },

  // 删除评论
  deleteComment: (id) => {
    return del(`/comments/${id}`)
  },

  // 获取所有评论列表
  getCommentList: () => {
    return get('/comments/list')
  },

  // 更新评论状态
  updateCommentStatus: (id, status) => {
    return put(`/comments/${id}/status`, { status })
  }
}

export default commentAPI